<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8" />
        <title>个人信息-{eyou:global name='web_name' /}</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
        <link href="{eyou:global name='web_cmspath'/}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        {eyou:static file="users/skin/css/eyoucms.css"/}
        {eyou:static file="users/skin/css/element/index.css"/}
        {eyou:static file="users/skin/css/e-user.css"/}
        {eyou:include file="users/skin/css/diy_css.htm"/}
        {eyou:static file="/public/static/common/js/jquery.min.js"/}
        {eyou:static file="/public/plugins/layer-v3.1.0/layer.js"/}
        {eyou:static file="/public/static/common/js/tag_global.js"/}
    </head>

    <body >
        {eyou:include file="users/users_header.htm" /}
        <div class="breadcrumbs"></div>

        <div class="ey-body-bg">
            <div class="ey-body pd0">
                <div class="ey-container w1226">
                    {eyou:include file="users/users_left.htm" /}
                    <div class="ey-con fr" >
                        <div class="el-main user-info-con main-bg">
                            <div class="user-info-box">
                                <div class="user-info-title"><h1>个人信息</h1></div>
                                <div class="user-info">
                                    <div class="info">
                                        <div class="item-from-row user-info-pic">
                                            <div class="from-row-l">头像：</div>
                                            <div class="from-row-r ">
                                                <div class="el-upload el-upload--text face" onclick="$('#uploadHeadPicClick').trigger('click');">
                                                    <img id="uploadHeadPicImg" class="img-fluid rounded-circle" src="{$users.head_pic|get_head_pic=###}"/>
                                                    <span title="编辑头像" class="el-icon-edit-outline"></span>
                                                </div>
                                                <input type="file" id="uploadHeadPicClick" onchange="uploadHeadPicFile(this);" style="display: none;">
                                            </div>
                                        </div>

                                        <div class="item-from-row">
                                            <div class="from-row-l">用户名：</div>
                                            <div class="from-row-r">{$users.username}</div>
                                        </div>

                                        <form name='theForm' id="theForm">
                                            <input type="hidden" name="head_pic_edit" id="uploadHeadPicDdit" value="0">
                                            <input type="hidden" name="head_pic" id="uploadHeadPic" value="{$users.head_pic}">
                                            <div class="item-from-row">
                                                <div class="from-row-l">修改密码：</div>
                                                <div class="from-row-r">
                                                    <input type="text" name="password_edit" id="password_edit" autocomplete="off" class="el-input__inner w310" placeholder="留空时默认不修改密码">
                                                </div>
                                            </div>

                                            <div class="item-from-row">
                                                <div class="from-row-l">昵称：</div>
                                                <div class="from-row-r">
                                                    <input type="text" name="nickname" value="{$users.nickname}" autocomplete="off" class="el-input__inner w310">
                                                </div>
                                            </div>
                                            <div class="item-from-row">
                                                <div class="from-row-l">绑定微信：</div>
                                                <div class="from-row-r">
                                                    {eyou:notempty name="$thirdparty['wx']"} 
                                                        {$thirdparty['wx']['nickname']}
                                                    {/eyou:notempty}
                                                    {eyou:if condition="!empty($thirdparty['wx']) && $users.users_id == $thirdparty['wx']['users_id']"}
                                                    <span class="err ml5"><a href="javascript:void(0);" onclick="un_wx_code();">解除绑定</a></span>
                                                    {else /}
                                                    <span class="err"><a href="javascript:void(0);" onclick="bind_wx_code();">绑定</a></span>
                                                    {/eyou:if}
                                                    
                                                    <script type="text/javascript">
                                                        var un_wx_code_url = "{eyou:url link='plugins/WxLogin/bindauth'/}";
                                                        var bind_wx_code_url = "{:url('plugins/WxLogin/login', ['fmdo'=>'bangding','bangding'=>1])}";
                                                    </script>
                                                    {eyou:static file="/public/static/common/js/wx_bind.js"/}
                                                </div>
                                            </div>

                                            <div class="item-from-row">
                                                <div class="from-row-l">会员等级：</div>
                                                <div class="from-row-r">
                                                    <span class="err">
                                                        {$users.level_name}
                                                    </span>
                                                </div>
                                            </div>
                                            {eyou:neq name='$users.level' value='1'}
                                            <div class="item-from-row">
                                                <div class="from-row-l">会员天数：</div>
                                                <div class="from-row-r">
                                                    <span class="">
                                                        <a href="{eyou:url link='user/Level/level_centre'/}">{$users.maturity_date}</a>
                                                    </span>
                                                </div>
                                            </div>
                                            {/eyou:neq}

                                            <!-- 更多资料中的会员属性 -->
                                            {eyou:include file="users/users_centre_field.htm" /}
                                            {eyou:volist name=":users_log_off();" id='field'}
                                            <div class="item-from-row">
                                                <div class="from-row-l">
                                                    账号注销：
                                                </div>
                                                <div class="from-row-r">
                                                    <span class="err"><a href="JavaScript:void(0);" {$field.func}>{$field.text}</a></span>
                                                </div>
                                            </div>
                                            {$field.hidden}
                                            {/eyou:volist}

                                            <div class="item-from-row">
                                                <div class="from-row-l">&nbsp;</div>
                                                <div class="from-row-r">
                                                    <input type="button" onclick="submitSaveUsers();" class="user-info-button" value="保存资料"/>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {eyou:static file="users/skin/js/users_centre.js"/}
        <script type="text/javascript">
            // 修改会员属性信息
            function submitSaveUsers() {
                {$pwdJsCode|default=''}
                layer_loading('正在处理');
                $.ajax({
                    url : eyou_basefile + "?m=user&c=Users&a=centre_update&_ajax=1",
                    data: $('#theForm').serialize(),
                    type: 'post',
                    dataType: 'json',
                    success: function(res) {
                        layer.closeAll();
                        if (1 == res.code) {
                            showSuccessMsg(res.msg, function() {
                                window.location.reload();
                            });
                        } else {
                            showErrorAlert(res.msg);
                        }
                    },
                    error: function(e) {
                        layer.closeAll();
                        showErrorAlert(e.responseText);
                    }
                });
            }
        </script>
        {eyou:include file="users/users_footer.htm" /}